import React, { useEffect, useState } from 'react'
import { getSwApi } from '../../api/request'
import { Swiper } from 'antd-mobile';
import styles from './img.module.css'
function index() {
    const [list, setList] = useState([])
    const getData = () => {
        getSwApi().then(res => {
            console.log(res);
            setList(res.data.data)
        })
    }
    useEffect(() => {
        getData()
    }, [])
    return (
        <div>
            <Swiper loop autoplay>{
                list?.map(item => {
                    return <Swiper.Item key={item.id}>
                        <img src={item.image} alt="" className={styles.img}/>
                    </Swiper.Item>
                })
            }</Swiper>
        </div>
    )
}

export default index